import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import 'amfe-flexible'
import { ValidationProvider, ValidationObserver, extend, localize } from 'vee-validate' // 表单验证插件
import { required } from 'vee-validate/dist/rules'
import { Button, Swipe, SwipeItem, Popup } from 'mint-ui'
extend('required', {
  ...required,
  message: 'This field is required'
})
localize({
  en: {
    messages: {
      required: '此项为必填项',
      min: 'this field must have no less than {length} characters',
      max: (_, { length }) => `this field must have no more than ${length} characters`
    }
  }
})
Vue.component('ValidationProvider', ValidationProvider)
Vue.component('ValidationObserver', ValidationObserver)
Vue.component(Button.name, Button)
Vue.component(Swipe.name, Swipe)
Vue.component(SwipeItem.name, SwipeItem)
Vue.component(Popup.name, Popup)
Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
